import request from '@/utils/request'

// 查询发票列表
export function listTranslate(query) {
  return request({
    url: '/translate/translate/list',
    method: 'get',
    params: query
  })
}

// 查询发票详细
export function getTranslate(id) {
  return request({
    url: '/translate/translate/' + id,
    method: 'get'
  })
}

// 新增发票
export function addTranslate(data) {
  return request({
    url: '/translate/translate',
    method: 'post',
    data: data
  })
}

/**
 * 审批处理
 * @param {{}} data 
 * @returns 
 */
export function applyTranslate(data, component) {

  return request({
    url: '/translate/translate',
    method: 'put',
    data: data
  }).then(res => {
    component.$message({
       message: res.msg, 
       type: 'success'
  })

  return res;

});

}

// 修改发票
export function updateTranslate(data, component) {
  return request({
    url: '/translate/translate/translate',
    method: 'put',
    data: data
  }).then(res => {
    component.$message({
       message: res.msg, 
       type: 'success' 
    })
  });
}



// 删除发票
export function delTranslate(id) {
  return request({
    url: '/translate/translate/' + id,
    method: 'delete'
  })
}
